{extend name="public/base"/}
{block name="body"}
  {include file="public/qiye2" /}
{/block}
{block name="script"}
<script type="text/javascript">
  var addUrl = "{:url('index/cart/add')}",
      minusUrl = "{:url('index/cart/minus')}",
      clearUrl="{:url('index/cart/clear')}",
      cartListUrl ="{:url('index/cart/getCartlist')}";
</script>
<script src="__PUBLIC__/xsd/js/index.js" charset="utf-8"></script>
<script src="__PUBLIC__/xsd/js/cart.js?v=11321231" charset="utf-8"></script>

<script>
  $(function(){
    var is_member = "{$is_member}";
    if(is_member == 1){
      $.get("{:url('index/getSubscribe')}", function(data){
        if(data.value == 0){
          mui.alert('<img src="/public/images/qrcode_for_wx.jpg" style="width:100%;"><p style=" text-align: left;"><b>无法识别二维码</b><br />1、打开微信，点击‘添加朋友’<br />2、点击公众号<br />3、搜索公众号：贵阳鲜果屋<br />4、点击‘关注’，完成</p>', '请长按扫二维码关注公众号');
        }
      })
    }


    $(document).on('click', '.tgxd' , function(){
      var url = $(this).attr('data-url'),num = parseInt($('.carticon').attr('attr-quantity'))
      console.log($('.carticon').text());
      var subscribe = '{$subscribe}';
     
        if(num>0){
          window.location.href = "{:url('cart/qiye', ['cid'=>$cid ])}"
        }else{
          mui.toast('请添加购买的商品！')
        }
      
    })
    })
    $('.pref-info').click(function(){
      var info=$(this).text()
      mui.alert(info, '公告', '关闭',function() {

      });
    })
</script>
<script>
  $(function(){
    var hei = $('header').height()+$('.pref-info').height()+$('.cnavcom').height();
    console.log(hei);
    if(hei>108){
      hei = hei+'px'
      $('.mui-content').css({'padding-top':hei})
    }
  })
</script>
{include file="public/previewimage" /}
{/block}
